// components/panel/panel.js
const db = wx.cloud.database();
const currentOrdersCollection = db.collection('currentOrders');
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    orders: Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    flag: true
  },
  /**
   * 组件的方法列表
   */
  methods: {
    shopBag() {
      this.setData({
        flag: false
      })
    },
    addNum(e) {
      let index = e.currentTarget.dataset.index;
      this.triggerEvent("add", {mes:index})
    },
    subNum(e) {
      let index = e.currentTarget.dataset.index;
      this.triggerEvent("sub", {mes:index})
    },
    clearAll() {
      this.triggerEvent("clearAll")
    },
    quit() {
      this.triggerEvent("quit");
      this.setData({
        flag: true
      })
    }
  }
})
